<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.org/ui"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<title>Trabalho Fa7</title>
</h:head>
<h:body>


   <h:form id="cadastrarUsuarioForm">

		<h:outputText value="Usuário" /> <br /> 
		<!-- Usuário:  -->
		<h:inputText value="#{cadastrarUsuarioBean.usuario.username}" required="true" validatorMessage="Usuário deve entre 3 a 10 caracteres" requiredMessage="Campo Usuário obrigatório">
			<f:validateLength minimum="3" maximum="10"/>
		</h:inputText>
		<br /><br />
		
		<h:outputText value="Senha" /> <br /> 
		<h:inputSecret value="#{cadastrarUsuarioBean.usuario.password}" required="true" validatorMessage="Senha deve ter entre 3 e 10 caracteres" requiredMessage="Campo Senha obrigatório">
			<f:validateLength minimum="3" maximum="10"/>
		</h:inputSecret>
		<br /><br />
		
		<h:outputText value="Nome" /> <br />
		<h:inputText value="#{cadastrarUsuarioBean.perfilUsuario.nome}" required="true" validatorMessage="Nome deve ter entre 3 e 10 caracteres" requiredMessage="Campo Nome obrigatório">
		<f:validateLength minimum="3" maximum="10"/>
		</h:inputText>
		<br /><br />

		<h:commandButton value="Cadastrar" action="#{cadastrarUsuarioBean.cadastrarUsuario}" />

	</h:form>


</h:body>
</html>